package com.maimao.search.client;

import com.maimao.core.constant.ServiceContainer;
import com.maimao.core.interceptor.FeignInterceptor;
import com.maimao.core.model.resp.Result;
import com.maimao.model.goods.Category;
import com.maimao.model.goods.vo.GoodsInfo;
import com.maimao.search.client.factory.CateFallBackFactory;
import com.maimao.search.client.factory.GoodsFallBackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author MaoLin Wang
 * @date 2020/12/22 7:54 下午
 */
@RequestMapping("/goods/cate")
@FeignClient(contextId = "cateClient", value = ServiceContainer.GOODS_SERVICE, fallbackFactory = CateFallBackFactory.class, configuration = FeignInterceptor.class)
public interface CateClient {

    @PostMapping("/client/names")
    public Result<List<String>> selectNamesByIds(@RequestBody List<Integer> ids);

    @GetMapping("/client/batch")
    Result<List<Category>> selectByIds(@RequestBody List<Integer> ids);
}
